package com.njqy.ticket.util;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class ValidUtil {

    public static boolean validPhoneNumber(String phoneNumber) {
        if ((phoneNumber != null) && (!phoneNumber.isEmpty())) {
            return Pattern.matches("^1[3-9]\\d{9}$", phoneNumber);
        }
        return false;
    }

    public static boolean validDate(String valid) {
        String eL = "[0-9]{4}-[0-9]{2}-[0-9]{2}";
        Pattern p = Pattern.compile(eL);
        Matcher m = p.matcher(valid);
        return m.matches();
    }

}
